package com.fengqilin.myapp;

import android.app.Activity;
import android.content.Context;
import android.view.View;
import android.view.inputmethod.InputMethodManager;

public class InputMethodUtils {
    public static boolean isShowing(Context paramContext) {
        return ((InputMethodManager) paramContext.getSystemService(Context.INPUT_METHOD_SERVICE)).isActive();
    }

    public static void showOrHide(Context paramContext) {
        ((InputMethodManager) paramContext.getSystemService(Context.INPUT_METHOD_SERVICE)).toggleSoftInput(0, 2);
    }

    public static void showOrHide(Context paramContext, Activity paramActivity) {
        ((InputMethodManager) paramContext.getSystemService(Context.INPUT_METHOD_SERVICE)).hideSoftInputFromWindow(paramActivity.getCurrentFocus().getWindowToken(), 2);
    }

    public static void showOrHide(Context paramContext, View paramView) {
        ((InputMethodManager) paramContext.getSystemService(Context.INPUT_METHOD_SERVICE)).hideSoftInputFromWindow(paramView.getWindowToken(), 0);
    }
}
